<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>13-清除浮动-父级添加overflow</title>
  <style>
    .box {
      /* 子不教 父之过 */
      /* 优点：代码简洁 */
      /* 缺点：无法显示溢出的部分 */
      overflow: hidden;
      width: 900px;
      background-color: pink;
      margin: 0 auto;
    }

    .box .damao {
      float: left;
      width: 200px;
      height: 200px;
      background-color: khaki;
    }

    .box .ermao {
      float: left;
      width: 200px;
      height: 200px;
      background-color: purple;
    }

    .footer {
      height: 100px;
      background: sienna;
      margin-top: 100px;
    }
  </style>
</head>

<body>

  <div class="box">
    <div class="damao">大毛</div>
    <div class="ermao">二毛</div>
    <div class="ermao">二毛</div>
    <div class="ermao">二毛</div>
    <div class="ermao">二毛</div>
    <div class="ermao">二毛</div>
    <div class="ermao">二毛</div>
    <div class="ermao">二毛</div>
  </div>

  <div class="footer"></div>

</body>

</html>